package com.ruoyi.info.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.health.domain.ServiceType;
import com.ruoyi.health.service.IServiceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 服务类型(项目)管理Controller
 * 
 * @author dalian
 * @date 2023-08-06
 */
@RestController
@RequestMapping("/info/healthServiceType")
public class FrontServiceTypeController extends BaseController
{
    @Autowired
    private IServiceTypeService serviceTypeService;

    /**
     * 查询服务类型(项目)管理列表
     */
    @GetMapping("/list")
    public TableDataInfo list(ServiceType serviceType)
    {
        startPage();
        List<ServiceType> list = serviceTypeService.selectServiceTypeList(serviceType);
        return getDataTable(list);
    }


    /**
     * 获取服务类型下面的【服务项目】
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getServiceItem(@PathVariable("id") Long id)
    {
        return success(serviceTypeService.selectServiceTypeById(id));
    }



}
